assignments is package{

  type person is noone or someone{
    name has type ref string;
    spouse has type ref person;
    spouse default := noone;
  }
  
  type family is family{
    parents has type list of person;
    children has type ref list of person;
    children default := list of {};
  };
  
  var LL := list of {1; 2; 3; 4};
  
  var PP := list of { someone{name:="a"}; someone{name:="b"}; someone{name:="c"}};
  
  t2(A,B) is (A,B);
  
  main() do {
    var F := family{ parents=list{someone{name:="p"}; someone{name:="m"}} };
    
    var X := 0;
    
    assert X=0;
    X := X+1;
    assert X=1;
    
    PP[1].spouse:=someone{name:="d"};
    
    assert PP[1].spouse.name="d";
    
    logMsg(info,"PP is now $PP");
    
    PP[1].spouse.name:="e";
    
    logMsg(info,"PP[1].spouse.name = $(PP[1].spouse.name)");
    assert PP[1].spouse.name="e";
    
    F.children:=list{someone{name:="cc"}};
    logMsg(info,"F=$F");
    
    -- test multiple assignment
    var A := "fred";
    var B := 2;
    
    assert A="fred";
    assert B=2;
    
    (A,B) := ("peter",B)
    
    assert A="peter" and B=2;
    
    (A,B) := t2("john",3);
    
    assert A="john" and B=3;
  }
}